Skip to content

Conversation

@Yuvraj-cyborg
Copy link
Contributor

@Yuvraj-cyborg Yuvraj-cyborg commented Dec 8, 2025

Closes #19169 - spark ascii needs custom nullability.

Rationale for this change :

The current implementation of date_add UDF does not correctly handle nullability for its return type. This change ensures that the return type of the date_add function is nullable, following the expected null propagation behavior for SQL functions.

Changes in PR:

  • Modified the date_add UDF to make the return type nullable.
  • Ensured that the nullability of the result follows the behavior that if any input argument is nullable, the result will also be nullable.
  • Added unit tests verifying the new nullability behavior for date_add.

Test Coverage:

Yes, tests are included to verify the change.

User-facing Changes:

No user-facing changes.

@Yuvraj-cyborg Yuvraj-cyborg force-pushed the ascii_nullability branch 2 times, most recently from 47933b1 to acdbf72 Compare December 8, 2025 16:48
@github-actions github-actions bot added the logical-expr Logical plan and expressions label Dec 8, 2025
@Yuvraj-cyborg
Copy link
Contributor Author

@rluvaton hey, could you review it please !

@rluvaton
Copy link
Member

rluvaton commented Dec 9, 2025

I think changing here is too of a breaking change.
WDYT @Jefffrey

@Jefffrey
Copy link
Contributor

I think changing here is too of a breaking change. WDYT @Jefffrey

I think this makes sense to have, as I see the multiple PRs being raised to fix individual (Spark) functions and can see not having this as default makes it not very ergonomic for downstream functions; that said, we'd probably need some more investigation to make sure affected functions (i.e. all of them...) will play well with this change.

Perhaps we can raise a separate issue for this entirely (e.g. "Change default nullability of UDFs") so can have more visibility on the discussion?

@Jefffrey
Copy link
Contributor

I've raised #19511 for discussion

We won't proceed with the changes in this PR

@Jefffrey Jefffrey closed this Dec 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

logical-expr Logical plan and expressions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

spark ascii need to have custom nullability

3 participants